# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.Apigee.V1.Model.GoogleCloudApigeeV1TlsInfoConfig do
  @moduledoc """


  ## Attributes

  *   `ciphers` (*type:* `list(String.t)`, *default:* `nil`) - List of ciphers that are granted access.
  *   `clientAuthEnabled` (*type:* `boolean()`, *default:* `nil`) - Flag that specifies whether client-side authentication is enabled for the target server. Enables two-way TLS.
  *   `commonName` (*type:* `GoogleApi.Apigee.V1.Model.GoogleCloudApigeeV1CommonNameConfig.t`, *default:* `nil`) - Common name to validate the target server against.
  *   `enabled` (*type:* `boolean()`, *default:* `nil`) - Flag that specifies whether one-way TLS is enabled. Set to `true` to enable one-way TLS.
  *   `enforce` (*type:* `boolean()`, *default:* `nil`) - Flag that enforces TLS settings
  *   `ignoreValidationErrors` (*type:* `boolean()`, *default:* `nil`) - Flag that specifies whether to ignore TLS certificate validation errors. Set to `true` to ignore errors.
  *   `keyAlias` (*type:* `String.t`, *default:* `nil`) - Name of the alias used for client-side authentication in the following format: `organizations/{org}/environments/{env}/keystores/{keystore}/aliases/{alias}`
  *   `keyAliasReference` (*type:* `GoogleApi.Apigee.V1.Model.GoogleCloudApigeeV1KeyAliasReference.t`, *default:* `nil`) - Reference name and alias pair to use for client-side authentication.
  *   `protocols` (*type:* `list(String.t)`, *default:* `nil`) - List of TLS protocols that are granted access.
  *   `trustStore` (*type:* `String.t`, *default:* `nil`) - Name of the keystore or keystore reference containing trusted certificates for the server in the following format: `organizations/{org}/environments/{env}/keystores/{keystore}` or `organizations/{org}/environments/{env}/references/{reference}`
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :ciphers => list(String.t()) | nil,
          :clientAuthEnabled => boolean() | nil,
          :commonName => GoogleApi.Apigee.V1.Model.GoogleCloudApigeeV1CommonNameConfig.t() | nil,
          :enabled => boolean() | nil,
          :enforce => boolean() | nil,
          :ignoreValidationErrors => boolean() | nil,
          :keyAlias => String.t() | nil,
          :keyAliasReference =>
            GoogleApi.Apigee.V1.Model.GoogleCloudApigeeV1KeyAliasReference.t() | nil,
          :protocols => list(String.t()) | nil,
          :trustStore => String.t() | nil
        }

  field(:ciphers, type: :list)
  field(:clientAuthEnabled)
  field(:commonName, as: GoogleApi.Apigee.V1.Model.GoogleCloudApigeeV1CommonNameConfig)
  field(:enabled)
  field(:enforce)
  field(:ignoreValidationErrors)
  field(:keyAlias)
  field(:keyAliasReference, as: GoogleApi.Apigee.V1.Model.GoogleCloudApigeeV1KeyAliasReference)
  field(:protocols, type: :list)
  field(:trustStore)
end

defimpl Poison.Decoder, for: GoogleApi.Apigee.V1.Model.GoogleCloudApigeeV1TlsInfoConfig do
  def decode(value, options) do
    GoogleApi.Apigee.V1.Model.GoogleCloudApigeeV1TlsInfoConfig.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.Apigee.V1.Model.GoogleCloudApigeeV1TlsInfoConfig do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
